package com.sz.interviewpracticing.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sz.interviewpracticing.model.dto.questionBankQuestion.QuestionBankQuestionQueryRequest;
import com.sz.interviewpracticing.model.entity.QuestionBankQuestion;
import com.sz.interviewpracticing.model.entity.User;
import com.sz.interviewpracticing.model.vo.QuestionBankQuestionVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 题库题目关联服务
 */
public interface QuestionBankQuestionService extends IService<QuestionBankQuestion> {

    /**
     * 获取查询条件
     *
     * @param questionBankQuestionQueryRequest 查询条件
     * @return 查询条件
     */
    QueryWrapper<QuestionBankQuestion> getQueryWrapper(QuestionBankQuestionQueryRequest questionBankQuestionQueryRequest);

    /**
     * 获取题库题目关联封装
     *
     * @param questionBankQuestion 题库题目关联
     * @param request              请求
     * @return 题库题目关联封装
     */
    QuestionBankQuestionVO getQuestionBankQuestionVO(QuestionBankQuestion questionBankQuestion, HttpServletRequest request);

    /**
     * 分页获取题库题目关联封装
     *
     * @param questionBankQuestionPage 题库题目关联分页
     * @param request                  请求
     * @return 题库题目关联封装分页
     */
    Page<QuestionBankQuestionVO> getQuestionBankQuestionVOPage(Page<QuestionBankQuestion> questionBankQuestionPage, HttpServletRequest request);

    void validQuestionBankQuestion(QuestionBankQuestion questionBankQuestion, boolean add);

    /**
     * @description: 批量添加题目到题库
     * @author: hgh
     **/
    void batchAddQuestionsToBank(List<Long> questionIdList, Long questionBankId, User loginUser);

    /**
     * @description: 批量从题库移除题目
     * @author: hgh
     **/
    void batchRemoveQuestionsFromBank(List<Long> questionIdList, Long questionBankId);

    /**
     * @description: 对某一批操作进行事务管理
     * @author: hgh
     * @date: 2020/12/23 10:45
     **/
    void batchAddQuestionsToBankInner(List<QuestionBankQuestion> questionBankQuestions);

}
